﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WJP.Context;

namespace WJP.DataPortal
{
    /// <summary>
    /// 从服务端到客户端的返回数据结果
    /// </summary>
    [Serializable]
    public class DataPortalResult
    {
        /// <summary>
        /// 从服务器返回的业务对象
        /// </summary>
        public object ReturnObject { get; }

        /// <summary>
        /// 从服务器返回的全局内容
        /// </summary>
        public HybridDictionary GlobalContext { get; }

        /// <summary>
        /// 
        /// </summary>
        public DataPortalResult()
        {
            this.GlobalContext = DistributionContext.GetGlobalContext();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="returnObject"></param>
        public DataPortalResult(object returnObject)
        {
            this.ReturnObject = returnObject;
            this.GlobalContext = DistributionContext.GetGlobalContext();
        }
    }
}
